<template>
  <div>
  
    <center>
      <div class="col-md-12" style="padding-right:0px;padding-left:0px;">
        <div>
          <br>
          <form class="form-inline" style="text-align:left;">
            <label for="name">&nbsp;设备编号:</label>
            <input
              type="text"
              class="form-control"
              id="usnameval"
              placeholder="请输入设备编号"
              onkeyup="value=value.replace(/[^\w]/g,'')"
              maxlength="12"
            >
            <label for="name" style="display:none">&nbsp;类型:</label>
            <select id="typecx" class="form-control" style="display:none">
              <option value>--全部--</option>
              <option value="0">单色</option>
              <option value="1">双色</option>
              <option value="2">全彩</option>
              <option value="3">安卓</option>
            </select>

            <button type="button" class="btn btn-primary">查询</button>
            <button
              type="button"
              style="display:"
              class="btn btn-success"
              id="addt"
              data-toggle="modal"
              data-target="#myModal"
            >新增</button>
            <!--<button type="button" class="btn btn-primary"  >开启</button>
            <button type="button" class="btn btn-primary" id="add"  data-toggle="modal" data-target="#myModal">关闭</button>!-->
            <button
              type="button"
              class="btn btn-success"
              id="update"
              style="display:none"
              data-toggle="modal"
              data-target="#myModal"
            >新增</button>
            <button
              type="button"
              class="btn btn-info"
              id="state"
              style="display:none"
              data-toggle="modal"
              data-target="#myModalState"
            >状态</button>
            <button type="button" id="del" class="btn btn-warning">删除</button>
            <label for="name">&nbsp;操作:</label>
            <select class="form-control" id="zl">
              <option value="19">开屏</option>
              <option value="18">关屏</option>
              <option value="46">清空节目</option>
              <!--<option value="item-4">测试屏</option>!-->
              <option value="67">屏复位</option>
              <option value="52">切换app操作</option>
            </select>
            <button type="button" style="display:" class="btn btn-success" id="ok">确定</button>

            <button
              type="button"
              style="display:none"
              class="btn btn-primary wx"
              id="pf"
              data-toggle="modal"
              data-target="#myModalpf"
            >五星评分</button>
            
            <!-- <button type="button" style="display:" class="btn btn-success" id="set">设置</button> -->
            <button
              type="button"
              class="btn btn-primary wx"
              id="moveGroup"
              data-toggle="modal"
              data-target="#myModalGroup"
            >移动卡组</button>
          </form>
          <br>
        </div>
        <div class="col-md-2" style="padding-right:0px;padding-left:0px;display: none">
          <div class="panel panel-primary">
            <div class="panel-heading">
              <h3 class="panel-title">单位设备</h3>
            </div>
            <div class="panel-body">
              <companydeviceoperation></companydeviceoperation>
            </div>
          </div>
        </div>
        <div class="col-md-12" style="padding-right:0px;padding-left:0px;">
          <div class="panel panel-primary">
            <div class="panel-heading">
              <h3 class="panel-title">设备操作</h3>
            </div>
            <div class="panel-body" style="height:100%;padding:0px;">
              <div class="jqGrid_wrapper">
                <table id="table_list_1"></table>
                <div id="pager_list_1"></div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </center>
    <!--五星评分!-->
    <div
      class="modal fade"
      id="myModalpf"
      style="overflow:auto"
      tabindex="-1"
      role="dialog"
      aria-labelledby="myModalLabel"
      aria-hidden="true"
    >
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title" id="myModalLabel">五星评分</h4>
          </div>
          <div class="modal-body">
            <center>
              <table>
                <tr>
                  <td>
                    <input type="checkbox" id="wxis" checked>五星评分
                  </td>
                  <td>
                    <select id="Taxi_Five" class="form-control">
                      <option value="1">1</option>
                      <option value="2">2</option>
                      <option value="3">3</option>
                      <option value="4">4</option>
                      <option value="5" selected>5</option>
                    </select>
                  </td>
                </tr>
                <tr id="wx">
                  <td>
                    一星
                    <select name="fontcolor" class="form-control">
                      <option value="red">红色</option>
                      <option value="green">绿色</option>
                      <option value="yellow">黄色</option>
                      <option value="blue">蓝色</option>
                      <option value="purple">紫色</option>
                      <option value="cyan">青色</option>
                      <option value="white">白色</option>
                    </select>
                  </td>

                  <td>
                    二星&nbsp;
                    <select name="fontcolor" class="form-control">
                      <option value="red">红色</option>
                      <option value="green">绿色</option>
                      <option value="yellow">黄色</option>
                      <option value="blue">蓝色</option>
                      <option value="purple">紫色</option>
                      <option value="cyan">青色</option>
                      <option value="white">白色</option>
                    </select>
                  </td>

                  <td>
                    三星&nbsp;
                    <select name="fontcolor" class="form-control">
                      <option value="red">红色</option>
                      <option value="green">绿色</option>
                      <option value="yellow">黄色</option>
                      <option value="blue">蓝色</option>
                      <option value="purple">紫色</option>
                      <option value="cyan">青色</option>
                      <option value="white">白色</option>
                    </select>
                  </td>

                  <td>
                    四星&nbsp;
                    <select name="fontcolor" class="form-control">
                      <option value="red">红色</option>
                      <option value="green">绿色</option>
                      <option value="yellow">黄色</option>
                      <option value="blue">蓝色</option>
                      <option value="purple">紫色</option>
                      <option value="cyan">青色</option>
                      <option value="white">白色</option>
                    </select>
                  </td>

                  <td>
                    五星&nbsp;
                    <select name="fontcolor" class="form-control">
                      <option value="red">红色</option>
                      <option value="green">绿色</option>
                      <option value="yellow">黄色</option>
                      <option value="blue">蓝色</option>
                      <option value="purple">紫色</option>
                      <option value="cyan">青色</option>
                      <option value="white">白色</option>
                    </select>
                  </td>
                </tr>
              </table>
              <br>
              <button type="button" id="addpf" class="btn btn-primary">保存</button>
            </center>
          </div>
        </div>
      </div>
    </div>

    <div
      class="modal fade"
      id="myModal"
      style="overflow:auto"
      tabindex="-1"
      role="dialog"
      aria-labelledby="myModalLabel"
      aria-hidden="true"
    >
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title" id="myModalLabel">新增</h4>
          </div>
          <div class="modal-body">
            <ul id="myTab" class="nav nav-tabs">
              <li class="active">
                <a href="#jb" data-toggle="tab">基本</a>
              </li>
              <li>
                <a href="#gj" data-toggle="tab">高级</a>
              </li>
            </ul>
            <br>
            <div id="myTabContent" class="tab-content">
              <div class="tab-pane fade in active" id="jb">
                <form class="form-horizontal" role="form">
                  <div class="form-group" id="plcz">
                    <label for="firstname" class="col-sm-3 control-label">类型</label>

                    <div class="col-sm-9">
                      <select id="typecz" class="form-control">
                        <option value="0">单个</option>
                        <option value="1">批量</option>
                      </select>
                    </div>
                  </div>
                  <div class="form-group">
                    <label for="firstname" class="col-sm-3 control-label">
                      编号
                      <span style="color:red">*</span>
                    </label>
                    <div class="col-sm-9">
                      <input
                        type="text"
                        class="form-control"
                        maxlength="12"
                        id="deviceid"
                        placeholder="请输入编号"
                        onkeyup="value=value.replace(/[^\w]/g,'')"
                      >
                    </div>
                  </div>

                  <div class="form-group" id="sumdiv" style="display: none">
                    <label for="firstname" class="col-sm-3 control-label">
                      数量
                      <span style="color:red">*</span>
                    </label>
                    <div class="col-sm-9">
                      <input
                        type="text"
                        class="form-control"
                        maxlength="3"
                        id="sum"
                        onkeyup="this.value=this.value.replace(/\D/g,'')"
                        onafterpaste="this.value=this.value.replace(/\D/g,'')"
                        placeholder="请输入数量"
                      >
                    </div>
                  </div>

                  <div class="form-group">
                    <label for="firstname" class="col-sm-3 control-label">
                      名称
                      <span style="color:red">*</span>
                    </label>
                    <div class="col-sm-9">
                      <input
                        type="text"
                        class="form-control"
                        maxlength="20"
                        id="devicename"
                        placeholder="请输入名称"
                       onkeyup="this.value=this.value.replace(/[/\\\\r\n/\s//\//]/g,'')"  
                       onblur="this.value=this.value.replace(/[/\\\\r\n/\s//\//]/g,'')"
                      >
                      <span style="color: brown;"></span>
                    </div>
                  </div>
                  <div class="form-group" style="display: none">
                    <label for="firstname" class="col-sm-3 control-label">
                      所属单位
                      <span style="color:red">*</span>
                    </label>
                    <div class="col-sm-9">
                      <input
                        type="text"
                        class="form-control"
                        id="company_nameadd"
                        readonly="readonly"
                        placeholder="请选择所属单位"
                      >
                      <input type="hidden" id="co_idadd" value>
                      <span style="color: brown;"></span>
                     
                    </div>
                  </div>
                  <div class="form-group">
                    <label for="firstname" class="col-sm-3 control-label">类型</label>
                    <div class="col-sm-9">
                      <select id="type" class="form-control">
                        <option value="0">单色</option>
                        <option value="1">双色</option>
                        <option value="2">全彩</option>
                        <option value="3">安卓</option>
                      </select>
                    </div>
                  </div>
                  <div class="form-group">
                    <label for="firstname" class="col-sm-3 control-label">
                      屏宽
                      <span style="color:red">*</span>
                    </label>
                    <div class="col-sm-9">
                      <input
                        type="text"
                        class="form-control"
                        id="width"
                        onkeyup="this.value=this.value.replace(/\D/g,'')"
                        onafterpaste="this.value=this.value.replace(/\D/g,'')"
                        maxlength="11"
                        placeholder="请输入屏宽"
                       
                      >
                      <span style="color: brown;"></span>
                    </div>
                  </div>
                  <div class="form-group">
                    <label for="firstname" class="col-sm-3 control-label">
                      屏高
                      <span style="color:red">*</span>
                    </label>
                    <div class="col-sm-9">
                      <input
                        type="text"
                        class="form-control"
                        id="high"
                        onkeyup="this.value=this.value.replace(/\D/g,'')"
                        onafterpaste="this.value=this.value.replace(/\D/g,'')"
                        maxlength="11"
                        placeholder="请输入屏高"
                        
                      >
                      <span style="color: brown;"></span>
                    </div>
                  </div>
                </form>
              </div>
              <div class="tab-pane fade in" id="gj">
                <form class="form-horizontal" role="form" id="home">
                  <div class="form-group">
                    <label for="firstname" class="col-sm-3 control-label">节目容量</label>
                    <div class="col-sm-9">
                      <input
                        type="text"
                        class="form-control"
                        id="maxprogramnum"
                        onkeyup="this.value=this.value.replace(/\D/g,'')"
                        onafterpaste="this.value=this.value.replace(/\D/g,'')"
                        placeholder="请输入节目容量"
                      >
                      <span style="color: brown;"></span>
                    </div>
                  </div>

                  <div class="form-group">
                    <label for="firstname" class="col-sm-3 control-label">素材容量</label>
                    <div class="col-sm-9">
                      <input
                        type="text"
                        class="form-control"
                        id="maxPSDnum"
                        onkeyup="this.value=this.value.replace(/\D/g,'')"
                        onafterpaste="this.value=this.value.replace(/\D/g,'')"
                        placeholder="请输入素材容量"
                      >
                      <span style="color: brown;"></span>
                    </div>
                  </div>

                  <div class="form-group">
                    <label for="firstname" class="col-sm-3 control-label">区域容量</label>
                    <div class="col-sm-9">
                      <input
                        type="text"
                        class="form-control"
                        id="maxregionnum"
                        onkeyup="this.value=this.value.replace(/\D/g,'')"
                        onafterpaste="this.value=this.value.replace(/\D/g,'')"
                        placeholder="请输入区域容量"
                      >
                      <span style="color: brown;"></span>
                    </div>
                  </div>
                  <div class="form-group">
                    <label for="firstname" class="col-sm-3 control-label">安装位置</label>
                    <div class="col-sm-9">
                      <input type="text" class="form-control" id="address" placeholder="请输入安装位置">
                      <span style="color: brown;"></span>
                    </div>
                  </div>

                  <div class="form-group">
                    <label for="firstname" class="col-sm-3 control-label">经度</label>
                    <div class="col-sm-9">
                      <input type="text" class="form-control" id="Longitude" placeholder="请输入经度">
                      <span style="color: brown;"></span>
                    </div>
                  </div>
                  <div class="form-group">
                    <label for="firstname" class="col-sm-3 control-label">纬度</label>
                    <div class="col-sm-9">
                      <input type="text" class="form-control" id="Latitude" placeholder="请输入纬度">
                      <span style="color: brown;"></span>
                    </div>
                  </div>

                  <div class="form-group">
                    <label for="firstname" class="col-sm-3 control-label">说明</label>
                    <div class="col-sm-9">
                      <textarea class="form-control" rows="3" id="explain"></textarea>
                    </div>
                  </div>
                </form>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" id="add">保存</button>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <!-- 移动卡组 -->
    <div
      class="modal fade"
      id="myModalGroup"
      style="overflow:auto"
      tabindex="-1"
      role="dialog"
      aria-labelledby="myModalLabel"
      aria-hidden="true"
    >
        <div class="modal-dialog">
          <div class="modal-content">
            <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal" id="addclose" aria-hidden="true">&times;</button>
              <h4 class="modal-title" id="myModalLabel">移动卡组</h4>
           </div>      
            <div class="modal-body">
               <form class="form-horizontal" role="form"> 
              <div class="form-group">
                <label class="col-sm-3 control-label">卡号</label>
                <div class="col-sm-9">
                  <input type="text" class="form-control" id="deviceId" readonly>
                </div>
              </div>  
              <div class="form-group">
                <label class="col-sm-3 control-label">选择卡组</label>
                <div class="col-sm-9">
                    <input type="text" class="form-control" id="company_name" readonly="readonly" placeholder="请选择所属单位">
                    <input type="hidden" id="co_id" value>
                    <span style="color: brown;"></span>
                    <div
                          id="menuContenttow"
                          class="menuContent"
                          style=" display:none;z-index:999999; position: absolute;width:418px"
                      >
                       <loadingtow></loadingtow>
                   </div>
               </div>
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-default"  data-dismiss="modal">关闭</button>
               <button type="button" class="btn btn-primary" id="addGroup">保存</button>
         </div>
               </form>
        </div>
        
     </div>
   </div>
</div>

  <!-- 状态 -->
    <div
      class="modal fade"
      id="myModalState"
      style="overflow:auto"
      tabindex="-1"
      role="dialog"
      aria-labelledby="myModalLabel"
      aria-hidden="true"
      
    >
        <div class="modal-dialog modal-mg" style="width:800px">
          <div class="modal-content">
            <div class="modal-header" style="height:42px;padding:10px;">
              <button type="button" class="close" data-dismiss="modal" id="addclose" aria-hidden="true">&times;</button>
              <h4 class="modal-title" id="myModalLabel">当前节目</h4>
           </div>      
            <div class="modal-body">
               <form class="form-horizontal" role="form" id="iframeform"> 
            <iframe id="iframescr" name="iframescr" src="?#/page/device/progstate" width="100%" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="yes" allowtransparency="yes" style="height: 600px;">
             </iframe>
           
               </form>
        </div>
        
        
     </div>
   </div>
</div>

  </div>
</template>
<style>
/*@import '../../../../static/css/ztree/metroStyle.css';*/
@import "../../../../static/css/ztree/metroStyle.css";
</style>
<script>
import  '../../../../static/js/mloading/jquery.mloading.js';
import "../../../../static/js/jqgrid/jquery.jqGrid.min.js";
import "../../../../static/js/jqgrid/grid.locale-cn.js";
import "../../../../static/js/page/Device/list.js";
import "../../../../static/js/ztree/jquery.ztree.exedit.js";
import "../../../../static/js/ztree/jquery.ztree.exhide.js";
import "../../../../static/js/jquery-ui-jqLoding.js";
import companydeviceoperation from "@/views/tree/companydeviceoperation.vue";
//import functionalmodule from '@/views/tree/functionalmodule.vue';
import loadingtow from "@/views/tree/companywhole.vue";





export default {
  name: "app",
  data() {
    return {};
  },
  mounted() {},
  methods: {},
  components: {
    companydeviceoperation,
    //functionalmodule,
    loadingtow:loadingtow
 
  }
};
$(function() {
  $("#typecz").change(function() {
    //alert($(this).val());
    if ($(this).val() == "1") {
      $("#sumdiv").show();
    } else {
      $("#sumdiv").hide();
    }
  });

  $("#type").val(sessionStorage.getItem("type"));
  $("#high").val(sessionStorage.getItem("high"));
  $("#width").val(sessionStorage.getItem("width"));

  if (sessionStorage.getItem("isgroup") == "0") {
    $("#addt").hide();
    //
  }

  $("body").removeAttr("style");
  $("body").css("overflow", "hidden");

  $("#addt").click(function(){
    if (sessionStorage.getItem("isgroup") == "0"){
       $("#width").attr("readonly",false);
      $("#high").attr("readonly",false);
     
    }else{
      $("#width").attr("readonly",true);
      $("#high").attr("readonly",true);
    }
  });
});
</script>
